.frameContainer {
  display: flex;
  justify-content: center;
  grid-area: content;
  transform: scale(0.6);

  @media (min-width: 768px) {
    transform: scale(1);
  }
}

.outerFrame {
  position: relative;
  overflow: hidden;
  min-width: 520px;
  max-width: 920px;
}

.frame {
  transition: padding 200ms;
}

.transparentPattern {
  position: absolute;
  z-index: -1;
  background-image: linear-gradient(45deg, #1d1d1d 25%, transparent 0),
    linear-gradient(-45deg, #1d1d1d 25%, transparent 0), linear-gradient(45deg, transparent 75%, #1d1d1d 0),
    linear-gradient(-45deg, transparent 75%, #1d1d1d 0);
  background-position:
    0 0,
    0 10px,
    10px -10px,
    -10px 0;
  background-size: 20px 20px;
  inset: 0;
}

.window {
  display: flex;
  min-height: 100px;
  flex-direction: column;
  align-items: stretch;
  padding-top: 10px;
  border: 1px solid hsl(0 0% 100% / 0.3);
  border-radius: 18px;
  background: var(--frame-background);
  transition: all ease 0.3s;

  &.withBorder {
    border: none;
    box-shadow:
      0 0 0 1px var(--frame-highlight-border),
      0 0 0 1.5px var(--frame-shadow-border);
  }

  &.withShadow {
    border: none;
    box-shadow:
      0 0 0 1px var(--frame-highlight-border),
      0 0 0 1.5px var(--frame-shadow-border),
      0 2.8px 2.2px rgba(0, 0, 0, 0.034),
      0 6.7px 5.3px rgba(0, 0, 0, 0.048),
      0 12.5px 10px rgba(0, 0, 0, 0.06),
      0 22.3px 17.9px rgba(0, 0, 0, 0.072),
      0 41.8px 33.4px rgba(0, 0, 0, 0.086),
      0 100px 80px rgba(0, 0, 0, 0.12);
  }
}

.header {
  display: grid;
  height: 24px;
  align-items: center;
  padding: 0 16px;
  grid-gap: 12px;
  grid-template-columns: 60px 1fr 60px;
}

.controls {
  display: flex;
  gap: 9px;
}

.control {
  width: 14px;
  height: 14px;
  border-radius: 7px;
  background-color: var(--frame-control-color);
}

.fileName {
  position: relative;
  display: flex;
  height: 16px;
  align-items: center;
  justify-content: center;
  color: var(--frame-title-placeholder-color);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.32px;
  line-height: 12px;
  text-align: center;

  > input:focus + span {
    display: none;
  }

  > input {
    position: absolute;
    width: 100%;
    border: none;
    margin: 0;
    background-color: transparent;
    color: var(--frame-title-color);
    font-family: Inter, sans-serif;
    font-size: 12px;
    font-weight: 500;
    inset: 0;
    letter-spacing: 0.32px;
    line-height: 12px;
    text-align: center;

    &:focus {
      outline: none;
    }
  }
}

/* Vercel Theme Frame */

.vercelFrame {
  background: black;
}

.vercelFrameLightMode {
  background: white;

  .vercelGridlinesHorizontal,
  .vercelGridlinesVertical {
    &:before,
    &:after {
      background: #ebebeb;
    }
  }

  .vercelBracketLeft,
  .vercelBracketRight {
    &:before,
    &:after {
      background: #a8a8a8;
    }
  }
}

.vercelWindow {
  position: relative;
}

.vercelGridlinesHorizontal {
  &:before,
  &:after {
    position: absolute;
    top: 0;
    bottom: 0;
    left: -150px;
    width: 1200px;
    height: 1px;
    background: #1a1a1a;
    content: "";
  }

  &:after {
    top: auto;
    bottom: 0;
  }
}

.vercelGridlinesVertical {
  &:before,
  &:after {
    position: absolute;
    top: -150px;
    bottom: 0;
    left: 0;
    width: 1px;
    height: calc(100% + 300px);
    background: #1a1a1a;
    content: "";
  }

  &:after {
    right: 0;
    left: auto;
  }
}

.vercelBracketLeft,
.vercelBracketRight {
  position: absolute;
  top: -12px;
  left: -12px;
  display: flex;
  width: 25px;
  height: 25px;
  align-items: center;
  justify-content: center;

  &:before,
  &:after {
    position: absolute;
    background: #515356;
    content: "";
  }

  &:before {
    top: 12px;
    width: 100%;
    height: 1px;
  }

  &:after {
    left: 12px;
    width: 1px;
    height: 100%;
  }
}

.vercelBracketRight {
  top: auto;
  right: -12px;
  bottom: -12px;
  left: auto;
}

/* Trigger.dev Theme Frame */

.triggerFrame {
  background: #121317;
}

.triggerPatternTop {
  position: absolute;
  z-index: 0;
  top: 0;
  left: 0;
  width: 100%;
  height: 60%;
  background-repeat: repeat;
  background-size: 64px;
  mask-image: radial-gradient(circle farthest-corner at 50% 0%, black 20%, transparent 80%);
  pointer-events: none;
}

.triggerPatternBottom {
  position: absolute;
  z-index: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 60%;
  background-repeat: repeat;
  background-size: 64px;
  mask-image: radial-gradient(circle farthest-corner at 50% 100%, black 20%, transparent 80%);
  pointer-events: none;
}

.triggerGridlinesHorizontal {
  &:before,
  &:after {
    position: absolute;
    top: 0;
    bottom: 0;
    left: -150px;
    width: 1200px;
    height: 1px;
    background: #272a2e;
    content: "";
  }

  &:after {
    top: auto;
    bottom: 0;
  }
}

.triggerGridlinesVertical {
  &:before,
  &:after {
    position: absolute;
    top: -150px;
    bottom: 0;
    left: 0;
    width: 1px;
    height: calc(100% + 300px);
    background: #272a2e;
    content: "";
  }

  &:after {
    right: 0;
    left: auto;
  }
}

.triggerWindow {
  position: relative;
  background: #121317;
}

.triggerHeader {
  display: flex;
  width: 100%;
  height: 40px;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: #16181d;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
  gap: 12px;
}

.triggerFileName {
  position: relative;
  display: grid;
  height: 40px;
  align-items: center;
  color: #b5b8c0;
  font-family: "Geist Mono", monospace;
  font-size: 14px;
  line-height: 40px;
  vertical-align: top;

  input,
  & > span,
  &:after {
    position: static;
    z-index: 2;
    width: auto;
    min-width: 1em;
    padding: 0;
    border: none;
    margin: 0;
    appearance: none;
    background: none;
    font: inherit;
    grid-area: 1 / 2;
    resize: none;
    text-align: left;
  }

  & > span {
    position: relative;
    z-index: 1;
  }

  input {
    color: inherit;
  }

  &:after {
    content: attr(data-value) " ";
    visibility: hidden;
  }
}

.triggerLanguage {
  height: 40px;
  color: #5f6570;
  font-family: "Geist Mono", monospace;
  font-size: 14px;
  line-height: 40px;
}

.triggerFrameLightMode {
  background: #fafafa;

  .triggerWindow {
    background: #f5f5f5;
  }

  .triggerHeader {
    border-bottom: 1px solid #e5e5e5;
    background: #f8f8f8;
  }

  .triggerFileName {
    color: #171717;
  }

  .triggerLanguage {
    color: #707070;
  }

  .triggerGridlinesHorizontal,
  .triggerGridlinesVertical {
    &:before,
    &:after {
      background: #d9d7d7;
    }
  }

  .triggerPatternTop,
  .triggerPatternBottom {
    opacity: 0.1;
  }
}

/* Supabase theme frame */

.supabaseFrame {
  background: #121212;
}

.supabaseWindow {
  border: 1px solid #292929;
  border-radius: 6px;
  background: #171717;
}

.supabaseHeader {
  display: flex;
  height: 40px;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid #292929;
  background: #1f1f1f;
  border-top-left-radius: 5px;
  border-top-right-radius: 5px;
  gap: 12px;
}

.supabaseFileName {
  position: relative;
  display: grid;
  height: 40px;
  align-items: center;
  color: #fafafa;
  font-family: "IBM Plex Mono", monospace;
  font-size: 14px;
  line-height: 40px;
  vertical-align: top;

  input,
  & > span,
  &:after {
    position: static;
    z-index: 2;
    width: auto;
    min-width: 1em;
    padding: 0;
    border: none;
    margin: 0;
    appearance: none;
    background: none;
    font: inherit;
    grid-area: 1 / 2;
    resize: none;
    text-align: left;
  }

  & > span {
    position: relative;
    z-index: 1;
  }

  input {
    color: inherit;
  }

  &:after {
    content: attr(data-value) " ";
    visibility: hidden;
  }

  &:before {
    position: absolute;
    bottom: 0px;
    left: 0;
    width: 100%;
    height: 1px;
    background: currentColor;
    content: "";
  }
}

.supabaseLanguage {
  height: 40px;
  color: #898989;
  font-family: "IBM Plex Mono", monospace;
  font-size: 14px;
  line-height: 40px;
}

.supabaseFrameLightMode {
  background: #fcfcfc;

  .supabaseWindow {
    border-color: #dfdfdf;
    background: #f8f8f8;
  }

  .supabaseHeader {
    border-color: #dfdfdf;
    background: #fcfcfc;
  }

  .supabaseFileName {
    color: #171717;
  }

  .supabaseLanguage {
    color: #707070;
  }
}

/* Tailwind Frame */
.tailwindFrame {
  position: relative;
  background: #0f172a;
}

.tailwindWindow {
  position: relative;
  z-index: 1;
  border: 1px solid color(display-p3 0.8235 0.9451 1 / 0.25);
  border-radius: 8px;
  background: color(display-p3 0.1176 0.1608 0.2314);
}

.tailwindBeams {
  position: absolute;
  z-index: 0;
  top: -200px;
  left: 50%;

  width: 1293px;
  max-width: none;
  height: auto;
  pointer-events: none;
  transform: translateX(calc(-50% - 200px));
}

.tailwindHeader {
  composes: header;
  height: 34px;
  padding: 0 12px;
  border-bottom: 1px solid rgb(255 255 255 / 10%);

  .control {
    width: 10px;
    height: 10px;
    background-color: color(display-p3 0.2781 0.3345 0.4136);
  }
}

.tailwindGridlinesHorizontal {
  &:before,
  &:after {
    position: absolute;
    z-index: 2;
    top: -1.5rem;
    bottom: 0;
    left: -4rem;
    width: calc(100% + 8rem);
    height: 1px;
    background: color(display-p3 1 1 1 / 0.1);
    content: "";
    -webkit-mask-image: linear-gradient(to left, transparent, white 4rem, white calc(100% - 4rem), transparent);
    mask-image: linear-gradient(to left, transparent, white 4rem, white calc(100% - 4rem), transparent);
  }

  &:after {
    top: auto;
    bottom: -1.5rem;
  }
}

.tailwindGridlinesVertical {
  &:before,
  &:after {
    position: absolute;
    z-index: 2;
    top: -4rem;
    bottom: 0;
    left: -1.5rem;
    width: 1px;
    height: calc(100% + 8rem);
    background: color(display-p3 1 1 1 / 0.1);
    content: "";
    -webkit-mask-image: linear-gradient(to top, transparent, white 4rem, white calc(100% - 4rem), transparent);
    mask-image: linear-gradient(to top, transparent, white 4rem, white calc(100% - 4rem), transparent);
  }

  &:after {
    right: -1.5rem;
    left: auto;
  }
}

.tailwindGradient {
  position: absolute;
  z-index: -1;
  top: calc(100% + 1.5rem);
  left: 20px;
  overflow: hidden;
  width: 100%;
  height: 32px;
  margin-top: -1px;

  > div {
    display: flex;
    width: clamp(14rem, 80%, 40rem);
    height: 2px;
    margin-top: -1px;
  }
}

.tailwindGradient1 {
  width: 100%;
  flex: none;
  background: linear-gradient(
    90deg,
    color(display-p3 0.2196 0.7412 0.9725 / 0) 0%,
    color(display-p3 0.0549 0.6471 0.9137) 32.29%,
    color(display-p3 0.9255 0.2824 0.6 / 0.3) 67.19%,
    color(display-p3 0.9255 0.2824 0.6 / 0) 100%
  );
  filter: blur(4px);
}

.tailwindGradient2 {
  composes: tailwindGradient1;
  margin-left: -100%;
  filter: blur(1px);
}

.tailwindFrameLightMode {
  background: color(display-p3 1 1 1);

  &.noBackground {
    .tailwindWindow {
      background: rgb(255 255 255 / 100%);
    }
  }

  .tailwindWindow {
    background: rgb(255 255 255 / 75%);
    box-shadow:
      0 0 0 1px color(display-p3 0.0572 0.0889 0.1628 / 0.1),
      0px 2px 4px 0px color(display-p3 0 0 0 / 0.06);
  }

  &.isSafari {
    .tailwindWindow {
      border: 1px solid color(display-p3 0.0078 0.0235 0.0902 / 0.1);
      box-shadow: none;
    }
  }

  .tailwindHeader {
    border-color: rgb(0 0 0 / 10%);
  }
  .control {
    background-color: color(display-p3 0.8863 0.9098 0.9412);
  }
  .tailwindGridlinesHorizontal,
  .tailwindGridlinesVertical {
    &:before,
    &:after {
      background: color(display-p3 0.0078 0.0235 0.0902 / 0.1);
    }
  }
  .tailwindBeams {
    top: 0;
    transform: translateX(-50%);
  }
}

/* Clerk Frame */

.clerkFrame {
  background: #222222;
}

.clerkPattern {
  position: absolute;
  bottom: 0;
  left: -32px;
  width: calc(100% + 64px);
  height: 128px;
  mask-image: radial-gradient(farthest-side at 50% 100%, black, transparent);
  pointer-events: none;
}

.clerkWindow {
  position: relative;
  padding: 3px;
  border-radius: 8px;
  background: #111111;
  box-shadow:
    0 0 0 1px rgb(0 0 0 / 35%),
    0 1px 0 0 rgb(255 255 255 / 3%) inset,
    0 0 0 6px rgb(0 0 0 / 8%),
    0 72px 29px 0 rgb(0 0 0 / 2%),
    0 41px 24px 0 rgb(0 0 0 / 7%),
    0 18px 18px 0 rgb(0 0 0 / 11%),
    0 5px 10px 0 rgb(0 0 0 / 13%);
}

.clerkCode {
  border-radius: 5px;
  background: #191919;
  box-shadow:
    0 0 0 1px rgb(0 0 0 / 8%),
    0 14px 6px 0 rgb(0 0 0 / 4%),
    0 8px 5px 0 rgb(0 0 0 / 12%),
    0 3px 3px 0 rgb(0 0 0 / 20%),
    0 1px 2px 0 rgb(0 0 0 / 23%);
  --line-number: #484848;
}

.clerkHeader {
  display: flex;
  height: 40px;
  align-items: center;
  padding: 0 20px;
}

.clerkFrameLightMode {
  background: #f9f9f9;

  .clerkWindow {
    background: #f8f8f8;
    box-shadow:
      0 0 0 8px rgb(0 0 0 / 2%),
      0 1px 0 0 rgb(255 255 255 / 80%) inset,
      0 0 0 1px rgb(0 0 0 / 4%),
      0 113px 32px 0 rgb(0 0 0 / 0%),
      0 72px 29px 0 rgb(0 0 0 / 1%),
      0 41px 24px 0 rgb(0 0 0 / 2%),
      0 18px 18px 0 rgb(0 0 0 / 4%),
      0 5px 10px 0 rgb(0 0 0 / 4%);
  }

  .clerkPattern {
    opacity: 0.2;
  }

  .clerkCode {
    --line-number: #c9c9c9;
    background: #ffffff;
    box-shadow:
      0 0 0 1px rgb(0 0 0 / 2%),
      0 14px 6px 0 rgb(0 0 0 / 1%),
      0 8px 5px 0 rgb(0 0 0 / 3%),
      0 3px 3px 0 rgb(0 0 0 / 5%),
      0 1px 2px 0 rgb(0 0 0 / 6%);
  }
}

/* OpenAI Frame */

.openAIFrame {
  --line-number: rgba(255, 255, 255, 0.2);
  background: #121a29;
  font-family: var(--font-soehne-mono);

  /* Make non-highlighted lines grayscale */
  &:has(:global(.highlighted-line)) {
    :global(.line):not(:global(.highlighted-line)) {
      filter: grayscale(1);
      opacity: 0.5;
      transition:
        filter 1s,
        opacity 1s;
    }
  }

  .isHighlightingLines {
    :global(.line):not(:global(.highlighted-line)):hover {
      filter: none !important;
      opacity: 1 !important;
    }
  }
}

.openAIWindow {
  position: relative;
  z-index: 1;
  border: 0.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: #232b41;
  box-shadow:
    0px 100px 89px 0px rgba(0, 0, 0, 0.07),
    0px 41.778px 37.182px 0px rgba(0, 0, 0, 0.05),
    0px 22.336px 19.879px 0px rgba(0, 0, 0, 0.04),
    0px 12.522px 11.144px 0px rgba(0, 0, 0, 0.04),
    0px 6.65px 5.919px 0px rgba(0, 0, 0, 0.03),
    0px 2.767px 2.463px 0px rgba(0, 0, 0, 0.02);
}

.openAIFrameLightMode {
  background: linear-gradient(238deg, #f1f0f4 0%, #f8f8fd 100%);
  --line-number: hsla(240, 12%, 71%, 1);

  .openAIWindow {
    position: relative;
    border: 0.5px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    background: #fff;
    box-shadow:
      0px 73px 83px 0px rgba(0, 0, 0, 0.03),
      0px 4.855px 5.52px 0px rgba(0, 0, 0, 0.01),
      0px 2.02px 2.297px 0px rgba(0, 0, 0, 0.01);
  }
}

/* Prisma Frame */

.prismaFrame {
  --gradient-angle: 140deg;
  background: linear-gradient(var(--gradient-angle), #0c1d26 0%, #0a0c17 100%);
}

.prismaWindow {
  position: relative;
  overflow: visible;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background-color: var(--background);
  --radius: 10px;
  --frame-border-gradient: linear-gradient(var(--gradient-angle), #3e4083, #16544f);
  --background: hsla(223, 41%, 7%, 75%);

  [data-frameborder] {
    &:before {
      position: absolute;
      border: 1px solid transparent;
      border-radius: var(--radius);
      background: var(--frame-border-gradient) border-box;
      content: "";
      inset: 0;
      mask:
        linear-gradient(#fff 0 0) padding-box,
        linear-gradient(#fff 0 0);
      mask-composite: exclude;
      pointer-events: none;
    }
    &:nth-of-type(1):before {
      inset: -1px;
    }
    &:nth-of-type(2):before {
      border-radius: calc(var(--radius) + 6px);
      inset: -6px;
      opacity: 50%;
    }

    &:nth-of-type(3):before {
      border-radius: calc(var(--radius) + 11px);
      inset: -11px;
      opacity: 30%;
    }

    &:nth-of-type(4):before {
      border-radius: calc(var(--radius) + 16px);
      inset: -16px;
      opacity: 10%;
    }
  }
}

.prismaHeader {
  display: flex;
  height: 40px;
  align-items: center;
  justify-content: space-between;
  border-radius: 8px 8px 0 0;
  border-bottom: 1px solid #141818;
  background: rgba(0, 0, 0, 0.2);
  gap: 12px;
}

.prismaFileName {
  position: relative;
  display: grid;
  height: 40px;
  align-items: center;
  color: #31baaf;
  font-size: 12px;
  line-height: 40px;
  vertical-align: top;

  input,
  & > span,
  &:after {
    position: static;
    z-index: 2;
    width: auto;
    min-width: 1em;
    padding: 0 16px;
    border: none;
    margin: 0;
    appearance: none;
    background: none;
    font: var(--font-inter);
    font-weight: 500;
    grid-area: 1 / 2;
    letter-spacing: 0.4px;
    resize: none;
    text-align: left;
  }

  & > span {
    position: relative;
    z-index: 1;
  }

  input {
    color: inherit;
  }

  &:after {
    content: attr(data-value) " ";
    visibility: hidden;
  }

  &:before {
    position: absolute;
    bottom: 0px;
    left: 0;
    width: 100%;
    height: 1px;
    background: currentColor;
    content: "";
  }
}

.prismaFrameLightMode {
  background: linear-gradient(140deg, #e8e8ff 0%, #e7fefc 100%);

  &.noBackground {
    .prismaWindow {
      --background: hsl(193, 72%, 96%, 0.9);
    }
  }

  .prismaWindow {
    --background: hsl(193, 72%, 96%, 0.5);
    --frame-border-gradient: linear-gradient(var(--gradient-angle), #6164cc, #31baaf);
  }

  .prismaHeader {
    border-color: #dfdfdf;
    background: hsla(192, 72%, 96%, 0.9);
  }

  .prismaFileName {
    color: #16a394;
  }
}

/* Mintlify Frame */
.mintlifyFrame {
  background: #121212;
}

.mintlifyWindow {
  position: relative;
  z-index: 1;
  border-radius: 12px;
  background: #070a08;
  box-shadow:
    0px 173px 48px 0px rgba(0, 0, 0, 0),
    0px 110px 44px 0px rgba(0, 0, 0, 0.01),
    0px 62px 37px 0px rgba(0, 0, 0, 0.05),
    0px 28px 28px 0px rgba(0, 0, 0, 0.09),
    0px 7px 15px 0px rgba(0, 0, 0, 0.1);
}

.mintlifyHeader {
  display: flex;
  height: 40px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #141818;
  background: #010201;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
  gap: 12px;
}

.mintlifyFileName {
  position: relative;
  display: grid;
  height: 40px;
  align-items: center;
  color: #55d799;
  font-size: 12px;
  line-height: 40px;
  vertical-align: top;

  input,
  & > span,
  &:after {
    position: static;
    z-index: 2;
    width: auto;
    min-width: 1em;
    padding: 0 16px;
    border: none;
    margin: 0;
    appearance: none;
    background: none;
    font: var(--font-inter);
    font-weight: 500;
    grid-area: 1 / 2;
    letter-spacing: 0.4px;
    resize: none;
    text-align: left;
  }

  & > span {
    position: relative;
    z-index: 1;
  }

  input {
    color: inherit;
  }

  &:after {
    content: attr(data-value) " ";
    visibility: hidden;
  }

  &:before {
    position: absolute;
    bottom: 0px;
    left: 0;
    width: 100%;
    height: 1px;
    background: currentColor;
    content: "";
  }
}

.mintlifyPatternWrapper {
  position: absolute;
  top: 0;
  right: -25px;
  width: 700px;
  height: 600px;
  background: radial-gradient(49.63% 57.02% at 58.99% -7.2%, rgba(13, 147, 115, 0.1) 39.4%, rgba(0, 0, 0, 0) 100%);
}

.mintlifyPattern {
  position: absolute;
  top: 0;
  right: 0;
  width: 600px;
  max-width: none;
}

.mintlifyFrameLightMode {
  background: #f6fbf9;

  .mintlifyWindow {
    border-color: #dfdfdf;
    background: #ffffff;
    box-shadow:
      0px 173px 48px 0px rgba(0, 0, 0, 0),
      0px 110px 44px 0px rgba(0, 0, 0, 0.01),
      0px 62px 37px 0px rgba(0, 0, 0, 0.03),
      0px 28px 28px 0px rgba(0, 0, 0, 0.05),
      0px 7px 15px 0px rgba(0, 0, 0, 0.06);
  }

  .mintlifyHeader {
    border-color: #dfdfdf;
    background: #fcfcfc;
  }

  .mintlifyFileName {
    color: #0d9373;
  }

  .mintlifyLanguage {
    color: #707070;
  }
}

/* ElevenLabs Theme Frame */

.elevenLabsFrame {
  --background: #111;
  --border-color: #353535;
  --dot-color: white;

  background: var(--background);

  [data-grid="true"] {
    background: var(--border-color);
  }

  [data-dot="true"] {
    background: var(--dot-color);
  }

  :global(.highlighted-line):after {
    z-index: 1 !important;
    left: 0px !important;
    width: 1px !important;
  }
}

.elevenLabsFrameLightMode {
  --background: #fff;
  --border-color: #e5e7eb;
  --dot-color: black;
}

.elevenLabsWindow {
  position: relative;

  &:before {
    position: absolute;
    z-index: 1;
    width: 100%;
    height: 100%;
    border: 1px solid var(--border-color);
    border-radius: 24px;
    content: "";
    pointer-events: none;
  }
}

.elevenLabsEditor {
  position: relative;
  border-radius: 24px;
  background: var(--background);
}

.elevenLabsCircle {
  position: absolute;
  top: 50%;
  left: 50%;
  border: 1px solid var(--border-color);
  border-radius: 9999px;
  content: "";
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.elevenLabsGridlineHorizontalTop,
.elevenLabsGridlineHorizontalCenter,
.elevenLabsGridlineHorizontalBottom {
  position: absolute;
  left: -150px;
  width: 1200px;
  height: 1px;
  background: var(--border-color);
  content: "";
}

.elevenLabsGridlineHorizontalTop {
  top: 0;
}

.elevenLabsGridlineHorizontalCenter {
  top: 50%;
  transform: translateY(-50%);
}

.elevenLabsGridlineHorizontalBottom {
  bottom: 0;
}

.elevenLabsGridlineVerticalLeft,
.elevenLabsGridlineVerticalCenter,
.elevenLabsGridlineVerticalRight {
  position: absolute;
  top: -150px;
  bottom: 0;
  width: 1px;
  height: calc(100% + 300px);
  background: var(--border-color);
  content: "";
}

.elevenLabsGridlineVerticalLeft {
  left: 0;
}

.elevenLabsGridlineVerticalCenter {
  left: 50%;
  transform: translateX(-50%);
}

.elevenLabsGridlineVerticalRight {
  right: 0;
}

.elevenLabsDotTopLeft,
.elevenLabsDotTopRight,
.elevenLabsDotBottomLeft,
.elevenLabsDotBottomRight {
  position: absolute;
  z-index: 2;
  top: -1px;
  left: -1px;
  display: flex;
  width: 3px;
  height: 3px;
}

.elevenLabsDotBottomRight {
  top: auto;
  right: -1px;
  bottom: -1px;
  left: auto;
}

.elevenLabsDotBottomLeft {
  top: auto;
  bottom: -1px;
  left: -1px;
}

.elevenLabsDotTopLeft {
  top: -1px;
  left: -1px;
}

.elevenLabsDotTopRight {
  top: -1px;
  right: -1px;
  left: auto;
}

.elevenLabsGridlineCornerTopLeft,
.elevenLabsGridlineCornerTopRight,
.elevenLabsGridlineCornerBottomRight,
.elevenLabsGridlineCornerBottomLeft {
  position: absolute;
}

.elevenLabsGridlineCornerTopLeft {
  top: -200px;
  left: 0;
  width: 1px;
  height: 200px;
  transform: rotate(-45deg);
  transform-origin: bottom right;
}

.elevenLabsGridlineCornerTopRight {
  top: -200px;
  right: 0;
  width: 1px;
  height: 200px;
  transform: rotate(45deg);
  transform-origin: bottom left;
}

.elevenLabsGridlineCornerBottomRight {
  right: 0;
  bottom: -200px;
  width: 1px;
  height: 200px;
  transform: rotate(-45deg);
  transform-origin: top left;
}

.elevenLabsGridlineCornerBottomLeft {
  bottom: -200px;
  left: 0;
  width: 1px;
  height: 200px;
  transform: rotate(45deg);
  transform-origin: top right;
}

/* All Themes */

.bitmap {
  --frame-background: rgba(255, 255, 255, 0.95);

  &.withBackground {
    background-color: black;
    background-image: url("../assets/manifesto.png") !important;
    background-position: center top;
    background-repeat: no-repeat;
    background-size: 100%;
  }

  &.darkMode {
    --frame-background: rgba(0, 0, 0, 0.88);
  }
}

.noir {
  --frame-background: rgba(255, 255, 255, 0.95);

  &.withBackground {
    background-image: url("../assets/distortion.png") !important;
    background-position: center;
    background-size: cover;
  }

  &.darkMode {
    --frame-background: rgba(0, 0, 0, 0.9);
  }
}

.ice {
  --background: #f6f6f6;
  --dot-color: rgba(0, 0, 0, 0.12);

  &.withBackground {
    background-color: var(--background) !important;
    background-image: radial-gradient(var(--dot-color) 1px, transparent 0) !important;
    background-position: -8.5px -8.5px;
    background-repeat: repeat;
    background-size: 17px 17px;
    inset: 0;
  }

  .withShadow {
    border: none;
    box-shadow:
      0 0 0 1px var(--frame-highlight-border),
      0 0 0 1.5px var(--frame-shadow-border),
      0 4px 6px rgba(0, 0, 0, 0.05);
  }

  &.darkMode {
    --background: #0e0e0e;
    --dot-color: rgba(255, 255, 255, 0.09);
  }
}

.noBackground {
  background: none;

  [data-grid="true"],
  [data-dot="true"] {
    display: none;
  }
}

.resend {
  --frame-background: hsla(0, 0%, 100%, 0.72);
  --selection-background: #00cc9937;
  --selection-text-color: #007763fd;
  --frame-header-background: hsla(0, 0%, 100%, 0.1);
  --frame-border: hsla(0, 0%, 24%, 0.13);
  --frame-border-radius: 8px;
  --frame-text-color: hsl(0, 0%, 0%);

  &.withBackground {
    background-image: url("../assets/resend/resend-pattern-light.png") !important;
    background-position: center;
    background-size: cover;

    &.darkMode {
      background-image: url("../assets/resend/resend-pattern-dark.png") !important;
    }
  }

  &::selection {
    background: var(--selection-background);
    color: var(--selection-text-color);
  }

  &.darkMode {
    --frame-background: hsla(0, 0%, 0%, 0.88);
    --frame-header-background: hsla(0, 0%, 0%, 0.9);
    --frame-border: hsla(0, 0%, 24%, 0.13);
    --frame-text-color: hsl(0, 0%, 98%);
    --selection-background: #00fff61d;
    --selection-text-color: #67ffded2;
  }
}

.resendWindow {
  position: relative;
  z-index: 1;
  border: 0.5px solid var(--frame-border);
  border-radius: var(--frame-border-radius);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  background: var(--frame-background);
}

.resendHeader {
  display: flex;
  height: 40px;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid var(--frame-border);
  background: var(--frame-header-background);
  border-top-left-radius: calc(var(--frame-border-radius) - 0.5px);
  border-top-right-radius: calc(var(--frame-border-radius) - 0.5px);
  gap: 12px;
}

.resendFileName {
  position: relative;
  display: grid;
  height: 40px;
  align-items: center;
  color: var(--frame-text-color);
  font-size: 14px;
  line-height: 40px;
  vertical-align: top;

  input,
  & > span,
  &:after {
    position: static;
    z-index: 2;
    width: auto;
    min-width: 1em;
    padding: 0;
    border: none;
    margin: 0;
    appearance: none;
    background: none;
    font: inherit;
    grid-area: 1 / 2;
    resize: none;
    text-align: left;
  }

  & > span {
    position: relative;
    z-index: 1;
  }

  input {
    color: inherit;
  }

  &:after {
    content: attr(data-value) " ";
    visibility: hidden;
  }
}

.resendLanguage {
  height: 40px;
  color: #898989;
  font-size: 14px;
  line-height: 40px;
}

/* Browserbase Theme Frame */

.browserbaseFrame {
  position: relative;
  height: 100%;
  background-color: hsla(0, 0%, 3%, 100%);
}

.browserbaseBackground {
  position: relative;
}

.browserbaseBackgroundGridline {
  position: absolute;
  width: 1px;
  height: 100%;
  border-left: 2px dashed rgba(255, 255, 255, 0.1);
  content: "";
  pointer-events: none;

  &:nth-child(1) {
    left: 5%;
  }
  &:nth-child(2) {
    left: 20%;
  }
  &:nth-child(3) {
    left: 35%;
  }
  &:nth-child(4) {
    left: 50%;
  }
  &:nth-child(5) {
    left: 65%;
  }

  &:nth-child(6) {
    left: 80%;
  }

  &:nth-child(7) {
    left: 95%;
  }
}

.browserbaseBackground {
  position: absolute;
  z-index: 0;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.browserbaseWindow {
  position: relative;
  z-index: 1;
  border: 2px solid rgba(255, 255, 255, 0.1);
  background: hsla(0, 0%, 6%, 100%);

  .header {
    height: 30px;
    padding-top: 10px;
  }

  .fileName {
    height: 24px;
    font-family: var(--font-space-mono), monospace;
    font-size: 14px;
    line-height: 24px;

    > input,
    & > span,
    &:after {
      font-family: var(--font-space-mono), monospace;
      font-size: 14px;
      line-height: 24px;
    }
  }
}

.browserbaseFrameLightMode {
  background: hsla(21.572, 35.722%, 96.76%);

  .browserbaseBackground {
    opacity: 1;
  }

  .browserbaseWindow {
    border-color: rgba(0, 0, 0, 0.3);
    background: hsla(240, 0%, 100%);
  }

  .browserbaseBackgroundGridline {
    border-color: rgba(0, 0, 0, 0.3);
  }

  .browserbaseHeader {
    border-bottom-color: rgba(0, 0, 0, 0.7);
  }

  .browserbaseLanguage {
    color: #000;
  }

  .browserbaseFileName {
    color: rgba(0, 0, 0, 0.6);

    & > span {
      color: rgba(0, 0, 0, 0.6);
    }
  }

  &.noBackground {
    background: transparent;
  }

  .browserbaseOutline {
    opacity: 1;
  }
}

.browserbaseFileName {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-family: var(--font-space-mono), monospace;
  font-size: 14px;
  font-weight: 500;
  line-height: 24px;
  text-align: center;
  white-space: nowrap;

  > input:focus + span {
    display: none;
  }

  > input,
  & > span,
  &:after {
    position: static;
    z-index: 2;
    width: auto;
    min-width: 1em;
    padding: 0;
    border: none;
    margin: 0;
    appearance: none;
    background: none;
    font: inherit;
    grid-area: 1 / 2;
    outline: none;
    resize: none;
    text-align: center;
  }

  & > span {
    position: relative;
    z-index: 1;
    color: rgba(255, 255, 255, 0.6);
  }

  input {
    color: inherit;
  }

  &:after {
    content: attr(data-value) " ";
    visibility: hidden;
  }
}

/* Nuxt Frame */

.nuxtFrame {
  --gradient-angle: 140deg;
  position: relative;
  background: #0b0c11;

  &.noBackground {
    background: transparent;

    .nuxtStars {
      display: none;
    }

    .nuxtWindow {
      --nuxt-background: rgba(11, 12, 17, 0.95);

      &:before,
      &:after {
        display: none;
      }
    }
  }
}

.nuxtStars {
  position: absolute;
  z-index: 0;
  width: 100%;
  height: 100%;
  inset: 0;
  object-fit: cover;
  opacity: 0.15;
  pointer-events: none;
}

.nuxtWindow {
  position: relative;
  z-index: 1;
  overflow: visible;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background-color: var(--nuxt-background);
  --radius: 10px;
  --nuxt-background: #0b0c11;
  --nuxt-border-gradient: linear-gradient(var(--gradient-angle), #00dc82, #00a86b);

  &:before {
    position: absolute;
    top: -200px;
    left: -200px;
    width: 250px;
    height: 180px;
    background: radial-gradient(ellipse, rgba(0, 220, 130, 0.6), transparent 70%);
    content: "";
    filter: blur(60px);
    pointer-events: none;
  }

  &:after {
    position: absolute;
    right: -200px;
    bottom: -200px;
    width: 250px;
    height: 180px;
    background: radial-gradient(ellipse, rgba(0, 220, 130, 0.6), transparent 70%);
    content: "";
    filter: blur(60px);
    pointer-events: none;
  }

  [data-frameborder] {
    position: absolute;
    border-radius: var(--radius);
    pointer-events: none;

    &:before {
      position: absolute;
      padding: 1px;
      border-radius: inherit;
      background: linear-gradient(
        135deg,
        #00dc82 0%,
        #00dc82 8%,
        transparent 20%,
        transparent 80%,
        #00dc82 92%,
        #00dc82 100%
      );
      content: "";
      inset: 0;
      -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
      mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
      -webkit-mask-composite: xor;
      mask-composite: exclude;
    }

    &:nth-of-type(1) {
      border-radius: var(--radius);
      inset: -1px;
    }

    &:nth-of-type(2) {
      border-radius: calc(var(--radius) + 8px);
      inset: -8px;
      &:before {
        background: linear-gradient(
          135deg,
          #00dc82 0%,
          #00dc82 10%,
          transparent 26%,
          transparent 74%,
          #00dc82 90%,
          #00dc82 100%
        );
        opacity: 0.5;
      }
    }

    &:nth-of-type(3) {
      border-radius: calc(var(--radius) + 15px);
      inset: -14px;
      &:before {
        background: linear-gradient(
          135deg,
          #00dc82 0%,
          #00dc82 12%,
          transparent 28%,
          transparent 72%,
          #00dc82 88%,
          #00dc82 100%
        );
        opacity: 0.25;
      }
    }
  }

  --line-number: #8b949e;
  --line-number-opacity: 1;

  :global(.highlighted-line) {
    background-color: rgba(25, 30, 35, 0.7) !important;

    &:after {
      display: none !important;
    }
  }

  &:has(:global(.highlighted-line)) {
    :global(.line):not(:global(.highlighted-line)) {
      opacity: 0.35;
    }
  }
}

.nuxtFrameLightMode {
  background: linear-gradient(var(--gradient-angle), #f8faf9 0%, #f0f9f4 100%);

  &.noBackground {
    background: transparent;

    &:before {
      display: none;
    }

    .nuxtStars {
      display: none;
    }

    .nuxtWindow {
      --nuxt-background: rgba(248, 250, 249, 0.95);
    }
  }

  &:before {
    background: radial-gradient(circle, rgba(0, 220, 130, 0.06), transparent 70%);
  }

  .nuxtStars {
    opacity: 0.03;
  }

  .nuxtWindow {
    --nuxt-background: transparent;
    --nuxt-border-gradient: linear-gradient(var(--gradient-angle), #3da896, #00dc82);
    --line-number: #78909c;
    --line-number-opacity: 1;

    &:before,
    &:after {
      display: none;
    }
  }

  :global(.highlighted-line) {
    background-color: rgba(224, 242, 232, 0.9) !important;

    &:after {
      display: none !important;
    }
  }

  &:has(:global(.highlighted-line)) {
    :global(.line):not(:global(.highlighted-line)) {
      opacity: 0.4;
    }
  }
}
